import { request } from 'umi';
import { MasterID, SerialID, carId, cityId } from '../utils/interface';

//获取首页汽车品牌数据
export function IFirst() {
  return request('https://baojia.chelun.com/v2-car-getMasterBrandList.html');
}
//获取右边弹出盒子的数据
export function IMargin(data: MasterID) {
  // console.log(data)
  return request(
    'https://baojia.chelun.com/v2-car-getMakeListByMasterBrandId.html',
    {
      params: {
        MasterID: data,
      },
    },
  );
}
//详情数据
export function IDetaile(data: SerialID) {
  return request('https://baojia.chelun.com/v2-car-getInfoAndListById.html', {
    params: {
      SerialID: data,
    },
  });
}
//询问底价跳入详情
export function IDdealer(data: { carId: any; cityId: any }) {
  return request('https://baojia.chelun.com/v2-dealer-alllist.html', {
    params: {
      // carId:data,cityId:data
      data,
    },
  });
}
//图片详情
export function IMgDetaile(data: SerialID) {
  return request('http://baojia.chelun.com/v2-car-getImageList.html', {
    params: {
      SerialID: data,
    },
  });
}

//颜色详情
export function IYearC(data: SerialID) {
  return request(
    'https://baojia.chelun.com/v2-car-getModelImageYearColor.html',
    {
      params: {
        SerialID: data,
      },
    },
  );
}
